# ! /usr/bin/env python
# coding=utf-8
import os
import time
import unittest
from appium import webdriver
from time import sleep
import HTMLTestRunner
from knowbox1.testBase import appiumBase
PATH = lambda p:os.path.abspath(os.path.join(os.path.dirname(__file__),p))
class CommonMethod(appiumBase):
#   判断是否存在某元素的方法
def isElementExist(driver, element):
    try:
        driver.find_element_by_xpath(element)
        return True
    except:
        return False

#  定义屏幕的宽高
   def getSize(self):
            x = self.driver.get_window_size()['width']
            y = self.driver.get_window_size()['height']
            return (x, y)


